import http from "@/utils/http";

/**
 * 加入购物车
 */
export const postMemberCart = (data) => {
  return http({
    url: "/member/cart",
    method: "post",
    data,
  });
};

/**
 * 购物车列表
 */
export const getMemberCart = () => {
  return http({
    url: "/member/cart",
  });
};

/**
 * 修改购物车商品
 */
export const putMemberCart = (skuId, data) => {
  return http({
    url: `/member/cart/${skuId}`,
    method: "PUT",
    data,
  });
};
/**
 * 购物车全选/取消全选 { selected: true },不传ids默认整个购物车修改
 */
export const putMemberCartSelected = (data) => {
  return http({
    url: `/member/cart/selected`,
    method: "PUT",
    data,
  });
};
/**
 * 删除购物车 { ids: [skuId1,skuId2]}
 */
export const deleteMemberCart = (data) => {
  return http({
    url: `/member/cart`,
    method: "delete",
    data,
  });
};
